module.exports = (err, ctx) => {
  let status = 200;
  /* switch (err.code) {
    case "10001":
      status = 400;
      break;
    case "10002":
      status = 409;
      break;
    default:
      status = 200;
  } */
  ctx.status = status;
  if (ctx.state.token && ctx.state.token != "") {
    //发现tokend存在则返回token
    err.token = ctx.state.token;
  } else {
    delete err.token;
  }
  ctx.body = err;
};
